package net.wanho.util;

/**
 * Author: Lun
 * Date: 2025-07-09 18:18
 * Description: 当前线程工具类
 */
public class CurrentUtils {
    private static ThreadLocal<Integer> localId = new ThreadLocal<>();
    public static void setId(Integer id){
        localId.set(id);
    }

    public static Integer getId(){
        return localId.get();
    }

    public static boolean isLogin(){
        return localId.get() != null;
    }

    public static void remove(){
        localId.remove();
    }
}
